h1 Register
form.form-horizontal(ng-submit="register()", name="registerForm", role="form")
    .form-group
        label.control-label.col-sm-2(for="username") Username
        .col-sm-10
            input.form-control(type="text", data-ng-model="username", placeholder="Username", name="username", required, data-ng-minlength="1", data-ng-maxlength="20", autofocus)
    .form-group
        label.control-label.col-sm-2(for="password") Password
        .col-sm-10
            input.form-control(type="password", data-ng-model="password", placeholder="Password", name="password", required, data-ng-minlength="5", data-ng-maxlength="60")
    .form-group
        .radio.radio-inline
            label
                input(type="radio", name="role", data-ng-model="role", id="adminRole", data-ng-value="userRoles.admin")
                | Administrator
        .radio.radio-inline
            label
                input(type="radio", name="role", data-ng-model="role", id="adminRole", data-ng-value="userRoles.user")
                | Normal user
    .form-group
        .controls
            button.btn(type="submit", data-ng-disabled="registerForm.$invalid") Submit

    .alert.alert-danger(ng-show="registerForm.$invalid && registerForm.$dirty")
        strong Please correct the following errors:
        ul
            li(ng-show="registerForm.username.$error.required") Username is required
            li(ng-show="registerForm.username.$error.minlength") Username has to be at least 1 character long
            li(ng-show="registerForm.username.$error.maxlength") Username has to be at most 20 character long
            li(ng-show="registerForm.password.$error.required") Password is required
            li(ng-show="registerForm.password.$error.minlength") Password must be at least 5 characters long
            li(ng-show="registerForm.password.$error.maxlength") Password must be at most 60 characters long